﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_GetPositionDutyTime]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_GetPositionDutyTime];
GO
CREATE PROCEDURE [dbo].[sproc_GetPositionDutyTime]
    @PositionID int 
AS
BEGIN
SET NOCOUNT ON

SELECT
    CONVERT(nvarchar(8), OnDutyTime, 108) AS OnDutyTime,
    CONVERT(nvarchar(8), OffDutyTime, 108) AS OffDutyTime
FROM
    dbo.UDS_WorkAttendence_DutyTime 
WHERE
    ID = @PositionID 
    and IDType = N'Position';

END
GO